package com.uidp.domain;

import com.acsior.dac.exeption.DataAccessException;
import com.acsior.sbc.exception.BusinessException;
import com.acsior.sbc.exception.ValidationException;
import com.acsior.sbc.impl.hibernate.HibernateBusinessObject;
import com.uidp.hibernatelayer.MenuDAO;
import com.uidp.hibernatelayer.MenuVO;

public class Menu extends HibernateBusinessObject<MenuVO, MenuDAO> {
	private Integer parentId;
	private String label;
	private String url;

	public Menu() throws BusinessException {
		super();
	}

	/**
	 * @param e
	 * @throws BusinessException
	 */
	public Menu(MenuVO h) throws BusinessException {
		super(h);
	}

	/** @see PersistentObject#initialize() */
	@Override
	protected void initialize() throws BusinessException {
		super.initialize();
	}

	@Override
	protected void setValues(MenuVO h) throws DataAccessException {
		h.setLabel(getLabel());
		h.setParentId(getParentId());
		h.setUrl(getUrl());

	}

	@Override
	protected void copyProperties(MenuVO d, boolean deepCopy)
			throws BusinessException {
		setLabel(d.getLabel());
		setParentId(d.getParentId());
		setUrl(d.getUrl());

	}

	@Override
	protected void validate() throws ValidationException {
		// TODO Auto-generated method stub

	}

	@Override
	protected Class<MenuDAO> getDAOClass() {
		return MenuDAO.class;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
